#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int i,n;
    float x,term,sum;
    cout<<"Enter the value of x :";
    cin>>x;
    cout<<"Enter the number of terms n :";
    cin>>n;
    term=sum=1;
    for(i=0;i<n;i++)
    {
        term*=x/i;
        sum+=term;
    }
    cout<<"e^"<<x<<"="<<sum<<endl;
    cin.get();
}
